/*
 * Copyright 2012 Alibaba.com All right reserved. This software is the
 * confidential and proprietary information of Alibaba.com ("Confidential
 * Information"). You shall not disclose such Confidential Information and shall
 * use it only in accordance with the terms of the license agreement you entered
 * into with Alibaba.com.
 */
package com.jrh.web.form;

import net.sf.cglib.beans.BeanCopier;

import com.jrh.domain.entity.Atlas;
import com.jrh.web.atlas.AtlasForm;

/**
 * form 转换类
 * 
 * @author jasen.hsu.cn@gmail.com 2012-7-26 下午5:05:45
 */
public class FormCopier {

    private static BeanCopier atlasForm2Do = BeanCopier.create(AtlasForm.class, Atlas.class, false);

    public static Atlas convert(AtlasForm atlasForm, Atlas atlas) {
        if (atlasForm == null) return atlas;
        if (atlas == null) atlas = new Atlas();
        atlasForm2Do.copy(atlasForm, atlas, null);
        return atlas;
    }

}
